package com.gitee.sop.notify.api.resp;

import lombok.Data;

import java.io.Serializable;


/**
 * @author 六如
 */
@Data
public class NotifyResponse implements Serializable {
    private static final long serialVersionUID = 5813802354743928430L;

    /**
     * 返回请求id
     */
    private Long notifyId;

    private Boolean success = true;

    private String msg;

    public static NotifyResponse success(Long notifyId) {
        NotifyResponse notifyResponse = new NotifyResponse();
        notifyResponse.setNotifyId(notifyId);
        notifyResponse.setSuccess(true);
        notifyResponse.setMsg("");
        return notifyResponse;
    }

    public static NotifyResponse error(String msg) {
        NotifyResponse notifyResponse = new NotifyResponse();
        notifyResponse.setNotifyId(null);
        notifyResponse.setSuccess(false);
        notifyResponse.setMsg(msg);
        return notifyResponse;
    }
}
